package com.luoshengsha.client;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean;

@Configuration
@Order(2)
public class OrderFactoryBean {
	//从application.properties中获取
	@Value("${custom.rmi_server}")
	private String rmi_server;
	
	@Bean
    public HttpInvokerProxyFactoryBean exporter() {
        HttpInvokerProxyFactoryBean b = new HttpInvokerProxyFactoryBean();
        b.setServiceUrl(rmi_server + "/OrderService");
        b.setServiceInterface(OrderService.class);
        return b;
    }
}
